package javaBase.nowcoder.HJ19_S_简单错误记录;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        //BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        Scanner scanner = new Scanner(System.in);
        String str;
        LinkedHashMap<String, Integer> data = new LinkedHashMap<String, Integer>();
        while (scanner.hasNext()) {
            str = scanner.nextLine();
            int idx1 = str.lastIndexOf(" ");
            int idx2 = str.lastIndexOf("\\");
            String key = (idx1 - idx2) > 16 ? str.substring(idx1 - 16) : str.substring(idx2 + 1);
            data.put(key, data.getOrDefault(key, 0) + 1);
        }
        scanner.close();
        int count = 0;
        for (String key : data.keySet()) {
            count++;
            if (count > (data.size() - 8)) {
                System.out.println(key + " " + data.get(key));
            }
        }
    }
}


